<!--
 * @Descripttion: 
 * @Author: ziwei
 * @Date: 2022-08-28 17:48:11
 * @LastEditors: ziwei
 * @LastEditTime: 2022-08-28 17:54:09
-->
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>set</title>
  </head>
  <body>
    <script>
      window.addEventListener("storage", function (e) {
        console.log('++++e',e);
        if (e.key === "ctc-msg") {
          const data = JSON.parse(e.newValue);
          const text = "[receive] " + data.msg + " —— tab " + data.from;
          console.log("[Storage I] receive message:", text);
        }
      });
    </script>
  </body>
</html>
